from openai import OpenAI
from fastapi import FastAPI, Query
from fastapi.staticfiles import StaticFiles
from fastapi import applications
from fastapi.openapi.docs import get_swagger_ui_html
from fastapi.responses import RedirectResponse
from fastapi.responses import FileResponse
from pydantic import BaseModel
from typing import List

client = OpenAI(
    api_key="ff434215ab8441a38b58c8ae700c0d50.YyJd8MOu6sAsWaH2",
    base_url="https://open.bigmodel.cn/api/paas/v4/",
)

modelName = "glm-4-plus"

# 定义数据模型
class Message(BaseModel):
    role: str
    content: str